#include <vector>
#include <iostream>

using namespace std;

bool judgeCircle(string moves) {
    int x = 0, y = 0;
    for(char s : moves){
        if(s == 'R') x++;
        if(s == 'L') x--;
        if(s == 'U') y++;
        if(s == 'D') y--;
    }
    return (x == 0 && y == 0) ? true : false;
}

int main(){
    string moves = "LL";
    cout << judgeCircle(moves) << endl;
    return 0;
}